package com.itheima.sh.d_method_04;

public class MethodDemo01 {
    //1.自定义方法求2个整数和值
    public static int sum(int a,int b){
        //求和值
        int sum=a+b;
        //返回和值
        return sum;
    }
    //调用自定义方法求2个整数和值
    public static void main(String[] args) {
        int a=sum(10,20);
        System.out.println("a = " + a);
        int b=sum(30,40);
        System.out.println("b = " + b);
    }
    
}
